package tienda1;

public class EnvTWSProxy implements tienda1.EnvTWS {
  private String _endpoint = null;
  private tienda1.EnvTWS envTWS = null;
  
  public EnvTWSProxy() {
    _initEnvTWSProxy();
  }
  
  public EnvTWSProxy(String endpoint) {
    _endpoint = endpoint;
    _initEnvTWSProxy();
  }
  
  private void _initEnvTWSProxy() {
    try {
      envTWS = (new tienda1.EnvTWSServiceLocator()).getEnvTWSPort();
      if (envTWS != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)envTWS)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)envTWS)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (envTWS != null)
      ((javax.xml.rpc.Stub)envTWS)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public tienda1.EnvTWS getEnvTWS() {
    if (envTWS == null)
      _initEnvTWSProxy();
    return envTWS;
  }
  
  public java.lang.String procesarEnvt(java.lang.String arg0) throws java.rmi.RemoteException{
    if (envTWS == null)
      _initEnvTWSProxy();
    return envTWS.procesarEnvt(arg0);
  }
  
  
}